package com.smart.lab.utils.net.listener;

/**
 * Created by liuyan on 2019/2/28.
 */




import com.smart.lab.utils.net.L;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

import okhttp3.ResponseBody;
import retrofit2.Call;

public abstract class UploadListener<T> {
    public UploadListener() {
    }

    public Type getType() {
        Type mySuperClass = this.getClazz().getGenericSuperclass();
        Type type = ((ParameterizedType)mySuperClass).getActualTypeArguments()[0];
        return type;
    }

    public Class getClazz() {
        return this.getClass();
    }

    public abstract void onResponse(T var2);

    public abstract void onProgress(long var1, long var3, boolean var5);

    public void onFailure(Call<ResponseBody> call, Throwable t) {
        L.e(t);
    }
}
